function closeDialog(){
	MsgBox.closeActiveDialog();
}
function query(){
	queryFinanceListAjax.send();
}
function reset(){
	orgsStaffTree.checkAllNodes(false);
	$("#staffQueryFrm")[0].reset();
}
function exportExcel(){
	MsgBox.confirm("确认导出","导出确认",function(){
		exportExcelAjax.send();
	});
}
function exportExcelAll(){
	MsgBox.confirm("确认导出全部","导出确认",function(){
		exportExcelAllAjax.send();
	});
}
function onExportAllSucc(){
//	if(data.success == true){
		window.open("sms/contraryFinance/exportExcel");
//	}else{
//		new $.zui.Messager('条件查询数据为空!', {
//			type: 'success',
//			time: 2000,
//			placement:'center'
//		}).show();
//	}
}
function onExportSucc(data){
	if(data.success == true){
		var custName = $("#custName").val();
		var loanNo = $("#loanNo").val();
		var dkStatus = $("#dkStatus").val();
		var startDate = $("#startDate").val();
		var endDate = $("#endDate").val();
		window.open("sms/contraryFinance/exportExcel?dkStatus="+dkStatus+"&custName="+custName+"&loanNo="+loanNo+"&startDate="+startDate+"&endDate="+endDate);
	}else{
		new $.zui.Messager('导出失败！数据为空!', {
		    type: 'success',
		    time: 2000,
		    placement:'center'
		}).show();
	}
}
function onDoubleClick(){
	var currRecord = financeDataTable.getCurrentRecord();
	console.log(currRecord.data.dkStatus);
	if(currRecord.data.dkStatus =="038002"){
		var url = ctx + "/sms/contraryFinance/dinanceIndex/" + currRecord.data.settleWithholdId +"/"+currRecord.data.chanName;
		MsgBox.open('financeDialog', '对公结清', url, "800px");
	}else{
		new $.zui.Messager('只能操作未还状态的数据!', {
		    type: 'success',
		    time: 2000,
		    placement:'center'
		}).show();
	}
}
function caiwuState(){
	$('#settleQueryFrm select[name="dkStatus"]')
		.find('option').each(function(){
			var value = $(this).attr('value');
			switch(value){
			case '':
				break;
			case '038001':
				break;
			case '038002':
				break;
			case '038003':
				break;
			default:
				$(this).remove();
			}
		});
	$('#settleQueryFrm select[name="dkStatus"]').val('038002');
	queryFinanceListAjax.send();
}
